package com.linzm.behavioraltype.iterator04;

/**
 * @Author zimingl
 * @Date 2023/4/16 3:24
 * @Description: IteratorPatternDemo
 */
public class IteratorPatternDemo {
    public static void main(String[] args) {
        NameRepository namesRepository = new NameRepository();
        for (Iterator iter = namesRepository.getIterator(); iter.hasNext(); ) {
            String name = (String) iter.next();
            System.out.println("Name : " + name);
        }
    }
}
